# the minimum version of CMake.
cmake_minimum_required(VERSION 3.5.0)
project(NativeDemo)

# 设置变量 NATIVERENDER_ROOT_PATH 为当前源代码目录的路径
set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})

if(DEFINED PACKAGE_FIND_FILE)
    include(${PACKAGE_FIND_FILE})
endif()

include_directories(${NATIVERENDER_ROOT_PATH}
                    ${NATIVERENDER_ROOT_PATH}/include)

# 创建一个名为 entry 的共享库，源文件是 napi_init.cpp
add_library(entry SHARED napi_init.cpp)
# 添加 demo 子目录到构建系统
add_subdirectory(demo)
# 将 libace_napi.z.so 和 calc 库链接到 entry 库
target_link_libraries(entry PUBLIC libace_napi.z.so calc)